﻿<%@ Page Title="" Language="C#" MasterPageFile="~/masDefault.master" AutoEventWireup="true" CodeFile="ShopRegister.aspx.cs" Inherits="ShopRegister" %>



<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="Server">
    <script src="/scripts/common.js" type="text/javascript"></script>
    <script type="text/javascript" src="/scripts/jquery.min.js"></script>
    <script type="text/javascript" src="/scripts/jquery.maskedinput-1.2.2.js"></script>

    <div id="contactForm">
        <h1 class="clearleft">Become Distributors</h1>
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

        <div class="pnError">
            <asp:ValidationSummary ID="vsumCustomer" runat="server" ShowMessageBox="false" ShowSummary="false" CssClass="errorMessage" />
            <asp:Label ID="lblErrorMessage" runat="server" CssClass="errorMessage"></asp:Label>
        </div>

        <asp:UpdatePanel ID="UpdatePanel1" runat="server" class="pnFormDis">
            <ContentTemplate>
                <table class="distributorForm">
                   
                    <tr id="trCountry" runat="server">
                        <td class="distributorFormLabel">
                            Country <span class="commentRequireInputText">*</span>:
                        </td>
                        <td class="distributorFormControl">
                            <asp:DropDownList ID="ddCountry" runat="server" CssClass="combobox" Width="235px"
                                AutoPostBack="false" OnSelectedIndexChanged="ddCountry_SelectedIndexChanged">
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="reqCountry" runat="server" EnableClientScript="true"
                                SetFocusOnError="true" CssClass="errorMessage" ErrorMessage="Country is require"
                                Display="Dynamic" ControlToValidate="ddCountry"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="distributorFormLabel" style="width: 140px;">
                            Company Name <span class="commentRequireInputText">*</span>:
                        </td>
                        <td class="distributorFormControl">
                            <asp:TextBox ID="txtCompanyName" runat="server" CssClass="txt txtDistributorCompanyName"
                                MaxLength="128"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="reqCompanyName" runat="server" EnableClientScript="true"
                                SetFocusOnError="true" CssClass="errorMessage" ErrorMessage="Company Name is require"
                                Display="Dynamic" ControlToValidate="txtCompanyName"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="distributorFormLabel">
                            Contact Name <span class="commentRequireInputText">*</span>:
                        </td>
                        <td class="distributorFormControl">
                            <asp:TextBox ID="txtContactName" runat="server" CssClass="txt txtDistributorContactName"
                                MaxLength="128"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="reqContactName" runat="server" EnableClientScript="true"
                                SetFocusOnError="true" CssClass="errorMessage" ErrorMessage="Contact Name is require"
                                Display="Dynamic" ControlToValidate="txtContactName"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="distributorFormLabel">
                            Address 1 <span class="commentRequireInputText">*</span>:
                        </td>
                        <td class="distributorFormControl">
                            <asp:TextBox ID="txtAddress1" runat="server" CssClass="txt txtDistributorAddess"
                                MaxLength="128"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="reqAddress1" runat="server" EnableClientScript="true"
                                SetFocusOnError="true" CssClass="errorMessage" ErrorMessage="Address 1 is require"
                                Display="Dynamic" ControlToValidate="txtAddress1"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="distributorFormLabel">
                            Address 2:
                        </td>
                        <td class="distributorFormControl">
                            <asp:TextBox ID="txtAddress2" runat="server" MaxLength="128" CssClass="txt txtDistributorAddess"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="distributorFormLabel">
                            City <span class="commentRequireInputText">*</span>:
                        </td>
                        <td class="distributorFormControl">
                            <asp:TextBox ID="txtCity" MaxLength="50" runat="server" CssClass="txt txtDistributorCity"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="reqCity" runat="server" EnableClientScript="true"
                                SetFocusOnError="true" CssClass="errorMessage" ErrorMessage="City is require"
                                Display="Dynamic" ControlToValidate="txtCity"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr id="trState" runat="server">
                        <td class="distributorFormLabel">
                            State <span class="commentRequireInputText">*</span>:
                        </td>
                        <td class="distributorFormControl">
                            <asp:DropDownList ID="ddlState" runat="server" CssClass="combobox" Width="235px">
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="reqState" runat="server" EnableClientScript="true"
                                SetFocusOnError="true" CssClass="errorMessage" ErrorMessage="City is require"
                                Display="Dynamic" ControlToValidate="ddlState"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="distributorFormLabel">
                            <asp:Label ID="lblZipCode" runat="server" Text="ZIP / Postal code">
                            </asp:Label>
                        </td>
                        <td class="distributorFormControl">
                            <asp:TextBox ID="txtPostalCode" runat="server" CssClass="txt txtDistributorPostal"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="reqPostalCode" runat="server" EnableClientScript="true"
                                SetFocusOnError="true" CssClass="errorMessage" ErrorMessage="Postal is require"
                                Display="Dynamic" ControlToValidate="txtPostalCode"></asp:RequiredFieldValidator>
                            <asp:CustomValidator ID="cusPostalCode" runat="server" EnableClientScript="true"
                                Display="Dynamic" ErrorMessage="RequiredFieldValidator" OnServerValidate="CheckSZipCode"
                                SetFocusOnError="true" ClientValidationFunction="CheckCZipCode" ControlToValidate="txtPostalCode"
                                CssClass="errorMessage"></asp:CustomValidator>
                        </td>
                    </tr>
                    <tr id="trProvince" runat="server">
                        <td class="distributorFormLabel">
                            Province / Region <span class="commentRequireInputText">*</span>:
                        </td>
                        <td class="distributorFormControl">
                            <asp:TextBox ID="txtProvince" runat="server" CssClass="txt txtDistributorProvince"
                                MaxLength="128"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="reqProvince" runat="server" EnableClientScript="true"
                                SetFocusOnError="true" CssClass="errorMessage" ErrorMessage="Postal is require"
                                Display="Dynamic" ControlToValidate="txtProvince"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="distributorFormLabel">
                            Phone <span class="commentRequireInputText">*</span>:
                        </td>
                        <td class="distributorFormControl">
                            <asp:TextBox ID="txtPhone" runat="server" CssClass="txt txtDistributorPhone" MaxLength="30"></asp:TextBox><font
                                color="#999999">(XXX-XXX-XXXX)</font>
                            <asp:RequiredFieldValidator ID="reqPhone" runat="server" EnableClientScript="true"
                                SetFocusOnError="true" CssClass="errorMessage" ErrorMessage="Postal is require"
                                Display="Dynamic" ControlToValidate="txtPhone"></asp:RequiredFieldValidator>
                            <asp:CustomValidator ID="cusPhone" runat="server" SetFocusOnError="true" EnableClientScript="true"
                                Display="Dynamic" ErrorMessage="RequiredFieldValidator" CssClass="errorMessage"
                                OnServerValidate="CheckSPhone" ClientValidationFunction="CheckCPhone" ControlToValidate="txtPhone"></asp:CustomValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="distributorFormLabel">
                            Fax:
                        </td>
                        <td class="distributorFormControl">
                            <asp:TextBox ID="txtFax" runat="server" CssClass="txt txtDistributorFax" MaxLength="30"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="distributorFormLabel">
                            Email <span class="commentRequireInputText">*</span>:
                        </td>
                        <td class="distributorFormControl">
                            <asp:TextBox ID="txtEmail" runat="server" CssClass="txt txtDistributorEmail" MaxLength="256"></asp:TextBox>
                            <font color="#999999">username@hostname.com</font>
                            <asp:RequiredFieldValidator ID="reqEmail" runat="server" EnableClientScript="true"
                                SetFocusOnError="true" CssClass="errorMessage" ErrorMessage="Postal is require"
                                Display="Dynamic" ControlToValidate="txtEmail"></asp:RequiredFieldValidator>
                            <asp:CustomValidator ID="cusEmail" CssClass="errorMessage" runat="server" EnableClientScript="true"
                                Display="Dynamic" ErrorMessage="RequiredFieldValidator" OnServerValidate="CheckSEmail"
                                SetFocusOnError="true" ClientValidationFunction="CheckCEmail" ControlToValidate="txtEmail"></asp:CustomValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="distributorFormLabel">
                            Confirm Email <span class="commentRequireInputText">*</span>:
                        </td>
                        <td class="distributorFormControl">
                            <asp:TextBox ID="txtConfirm" runat="server" CssClass="txt txtDistributorEmail" MaxLength="256"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="reqConfirmEmail" runat="server" EnableClientScript="true"
                                SetFocusOnError="true" CssClass="errorMessage" ErrorMessage="Postal is require"
                                Display="Dynamic" ControlToValidate="txtConfirm"></asp:RequiredFieldValidator>
                            <asp:CompareValidator ID="cmpConfirmEmail" runat="server" ControlToValidate="txtConfirm"
                                CssClass="errorMessage" ControlToCompare="txtEmail" ErrorMessage="CompareValidator"
                                SetFocusOnError="true"></asp:CompareValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="distributorFormLabel">
                            Note:
                        </td>
                        <td class="distributorFormControl">
                            <asp:TextBox ID="txtComment" runat="server" CssClass="txt txtDistributorComment"
                                MaxLength="512" TextMode="MultiLine"></asp:TextBox>
                        </td>
                    </tr>
                   
                </table>
            </ContentTemplate>
        </asp:UpdatePanel>
        <div class="pnButton">
            <asp:Button ID="btnSubmit" CssClass="btn" runat="server" Text="Submit"  OnClick="btnSubmit_Click" />
            <asp:Button ID="btnReset" runat="server" Text="Reset" CssClass="btn"  OnClientClick="return Reset();" />
        </div>
    </div>
    <div class="clear">
    </div>
    <script>
        jQuery(document).ready(function ($) {

            $("#<%=txtPhone.ClientID %>").mask("999-999-9999");

        });
    </script>
    <script type="text/javascript">
        function CheckCZipCode(oSrc, args) {

            args.IsValid = CheckZipCodeValid(args.Value);

        }
        function CheckCPhone(oSrc, args) {

            args.IsValid = CheckPhoneValid(args.Value);
        }
        function CheckCEmail(oSrc, args) {

            args.IsValid = CheckEmailValid(args.Value);

        }
        function Reset() {
            if (document.getElementById('<%=ddCountry.ClientID %>'))
                document.getElementById('<%=ddCountry.ClientID %>').value = '';
            if (document.getElementById('<%=ddlState.ClientID %>'))
                document.getElementById('<%=ddlState.ClientID %>').value = '';     
            document.getElementById('<%=txtCompanyName.ClientID %>').value = '';
            document.getElementById('<%=txtContactName.ClientID %>').value = '';
            document.getElementById('<%=txtAddress1.ClientID %>').value = '';
            document.getElementById('<%=txtAddress2.ClientID %>').value = '';
            document.getElementById('<%=txtCity.ClientID %>').value = '';
            document.getElementById('<%=txtPostalCode.ClientID %>').value = '';
            if(document.getElementById('<%=txtProvince.ClientID %>'))
                document.getElementById('<%=txtProvince.ClientID %>').value = '';
            document.getElementById('<%=txtPhone.ClientID %>').value = '';
            document.getElementById('<%=txtFax.ClientID %>').value = '';
            document.getElementById('<%=txtEmail.ClientID %>').value = '';
            document.getElementById('<%=txtConfirm.ClientID %>').value = '';
            document.getElementById('<%=txtComment.ClientID %>').value = '';
          
            return false;
        }
         
    </script>
</asp:Content>
